package com.xyf.listener;

import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(topic = "bootKeyTopic",
        consumerGroup = "boot-key-consumer-group",
        selectorType = SelectorType.TAG, // tag过滤模式
        selectorExpression = "tagA || tagB"
)
public class DKeyMsgListener implements RocketMQListener<MessageExt> {

    @Override
    public void onMessage(MessageExt message) {
        System.out.println(message.getKeys());
    }

}
